﻿@model IEnumerable<Authoring.WebRole.Models.ExhibitContentItem>

@{
    ViewBag.Title = "Index";
}

<h2>ExhibitContentItem - Index</h2>

<p>
    @if (ViewBag.write)
    {
        @Html.ActionLink("Create New", "Create")
    }
</p>
<table>
    <tr>
        <th></th>
        <th>
            Exhibit
        </th>
        <th>
            ContentItem
        </th>
        <th>
            Order
        </th>
        <th>
            CreatedBy
        </th>
        <th>
            CreatedOn
        </th>
        <th>
            ModifiedBy
        </th>
         <th>
            ModifiedOn
        </th>
   </tr>

@foreach (var item in Model) {
    <tr>
        <td>
        @if(ViewBag.delete) 
        {
            @Html.ActionLink("Edit", "Edit", new { id = item.ExhibitContentItemID })  
            @String.Format("{0}", "|");
            @Html.ActionLink("Details", "Details", new { id = item.ExhibitContentItemID }) 
            @String.Format("{0}", "|");
            @Html.ActionLink("Delete", "Delete", new { id = item.ExhibitContentItemID })
        }
        else if (ViewBag.write)
        {
            @Html.ActionLink("Edit", "Edit", new { id = item.ExhibitContentItemID }) 
            @String.Format("{0}", "|");
            @Html.ActionLink("Details", "Details", new { id = item.ExhibitContentItemID })
        }
        else if (ViewBag.read)
        { 
            @Html.ActionLink("Details", "Details", new { id = item.ExhibitContentItemID })
        }            
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Exhibit.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ContentItem.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Order)
        </td>
          <td>
            @Html.DisplayFor(modelItem => item.User.UserName)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.CreatedOn)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.User1.UserName)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.ModifiedOn)
        </td>
   </tr>
}

</table>
